package com.sw.bbs.board.dao;

import com.sw.bbs.board.pojo.Comment;
import com.sw.bbs.board.vo.request.comment.QueryCommentRequest;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CommentMapper {
    int deleteByPrimaryKey(Integer commentId);

    int insert(Comment record);

    int insertSelective(Comment record);

    Comment selectByPrimaryKey(Integer commentId);

    int updateByPrimaryKeySelective(Comment record);

    int updateByPrimaryKey(Comment record);


    /**
     * 用户评论列表
     * @param userId
     * @return
     */
    List<Comment> queryCommentsByUserId(@Param("userId") Integer userId);
    /**
     * 评论列表
     * @param request
     * @return
     */
    List<Comment> queryCommentByRequest(QueryCommentRequest request);
 }